package com.boot2.core.dao.exception;

import com.boot2.core.web.RequestContext;
import lombok.extern.apachecommons.CommonsLog;

import javax.servlet.http.HttpServletRequest;

/**
 * @author zhangweilin
 * @date 2018/7/4 17:05
 * @description: 数据类型不支持异常
 */
@CommonsLog
public class UnsupportDataTypeException extends RuntimeException {

    /**
     *
     */
    private static final long serialVersionUID = 1218895892012682138L;

    /**
     *
     */
    public UnsupportDataTypeException() {
        super();
    }

    /**
     * @param message
     * @param cause
     */
    public UnsupportDataTypeException(String message, Throwable cause) {
        super(message, cause);
        HttpServletRequest request = RequestContext.getRequest();
        if (null == request) {
            log.error(message, cause);
        }
    }

    /**
     * @param message
     */
    public UnsupportDataTypeException(String message) {
        super(message);
        HttpServletRequest request = RequestContext.getRequest();
        if (null == request) {
            log.error(message);
        }
    }

    /**
     * @param cause
     */
    public UnsupportDataTypeException(Throwable cause) {
        super(cause);
        HttpServletRequest request = RequestContext.getRequest();
        if (null == request) {
            log.error(cause);
        }
    }

}
